package com.block.test.service.impl;

import cn.hutool.core.util.IdcardUtil;
import com.alibaba.fastjson.JSONObject;
import com.block.common.bean.SessionBean;
import com.block.common.constant.AppRspCodeConstant;
import com.block.common.service.ISysConstantInfoService;
import com.block.common.vo.ResponseVo;
import com.block.test.service.IValidateService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class UpdateInfoValidateService extends IValidateService {


    @Autowired
    ISysConstantInfoService sysConstantInfoService;

    @Override
    public ResponseVo validate(JSONObject jsonObject, SessionBean sessionBean) {

        String idCard = jsonObject.getString("idCard");
        if (!IdcardUtil.isValidCard(idCard)){
            return new ResponseVo(AppRspCodeConstant.PARAM_ERROR, "请输入有效身份证信息", "");
        }

        return null;
    }
}
